﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Com.CMS263.PO;
using Com.CMS263.BLL;
using Com.CMS263.Util;


namespace Com.CMS263.Web.manage.MessageManage
{
    public partial class MessageList : System.Web.UI.Page
    {
        MessageBLL bll = new MessageBLL();
        public IList<PO.Message> meslist = new List<PO.Message>();
        int pageSize = 20;
        static int pageCount = 0;
        public int CurrentIndex
        {
            get { return Convert.ToInt32(ViewState["index"]); }
            set { ViewState["index"] = value; }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                BindData();
            }
        }
        public void BindData()
        {
            CurrentIndex = Convert.ToInt32(Request.QueryString.Get("page"));
            if (CurrentIndex == 0)
            {
                CurrentIndex = 1;
            }
            meslist = bll.GetListByPager(0,CurrentIndex,pageSize);
            
        }

        
        public string GetPager()
        {
            pageCount = bll.GetListByPager(0);
            return EnPager.GetPager(pageCount, pageSize, CurrentIndex,"");
        }
    }
}
